#include <iostream>
using namespace std;

int main(){
    int current = 0, val = 0;

    if (cin >> current){
        int cnt = 1;
        while (cin >> val){
            if (current == val){
                cnt++;
            } else{
                cout << current << "出现了" << cnt << "次" << endl;
                current = val;
                cnt = 1;
            }
        }

        cout << current << "出现了" << cnt << "次" << endl;
    }

    return 0;
}
